package CA;

import junit.framework.TestCase;

public class Scrape_Helper_Test extends TestCase {
	
	
	
	public void testGetURLFromFile()
	{
		Scrape_Helper sh = new Scrape_Helper();
		
		
	//	System.out.println(sh.convertInputToSeconds("1.5 hours before submission"));
		
		
		assertEquals(5400,sh.convertInputToSeconds("1.5 hours before submission"));
		assertEquals(1391040,sh.convertInputToSeconds("2.3 weeks since version was first installed."));
		
		assertEquals(552,sh.convertInputToSeconds("9.2 minutes since version was first installed."));
		assertEquals(288,sh.convertInputToSeconds("4.8 minutes since version was first installed."));
		assertEquals(665280,sh.convertInputToSeconds("1.1 weeks before submission"));

		// month
		assertEquals(3369600,sh.convertInputToSeconds("1.3 months before submission"));
		
		// add in seconds
		assertEquals(60,sh.convertInputToSeconds("60 seconds before submission"));
		
		//invalid value
		assertEquals(0,sh.convertInputToSeconds("blahbefore submission"));	
		
		
		
	}

}
